import Router from 'vue-router';

import Home from '../views/home.vue';
import Login from '../views/login.vue';
import Center from '../views/center.vue';
import Menuhome from '../views/menuhome.vue';
import Enword from '../views/menuhome/enword.vue';
import Etyma from '../views/menuhome/etymapanel.vue';
const router = new Router({
    routes:[
        {path:'/',redirect:'/login'},
        {path:'/login',component:Login} ,
        {path:'/home',component:Home} ,
        {path:'/center',component:Center},
        {
            path:'/menuhome',component:Menuhome,
            meta:{name:'/menuhome',potential:['enword','etyma']},
            children:[
                {path:'enword',component:Enword,meta:'enword'},
                {path:'etyma',component:Etyma,meta:'etyma'}
            ]
        }
    ]
});

router.beforeEach((to,from,next)=>{
    console.log('----------------- router.beforeEach -----------------');
    console.log(to);
    console.log(from);
    next();
});

export default  router;